package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * PosApp entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_POSAPP", uniqueConstraints = @UniqueConstraint(columnNames = "APP_NO"))
public class PosApp implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -3356071630670871065L;
	private String factoryId;
	private String modelNo;
	private String appNo;
	private String appVersion;
	private String appName;
	private String appFlag;
	private String appBirthday;
	private Integer appProgSize;
	private String appProgName;

	// Constructors

	/** default constructor */
	public PosApp() {
	}

	/** full constructor */
	public PosApp(String factoryId, String modelNo, String appNo,
			String appVersion, String appName, String appFlag,
			String appBirthday, Integer appProgSize, String appProgName) {
		this.factoryId = factoryId;
		this.modelNo = modelNo;
		this.appNo = appNo;
		this.appVersion = appVersion;
		this.appName = appName;
		this.appFlag = appFlag;
		this.appBirthday = appBirthday;
		this.appProgSize = appProgSize;
		this.appProgName = appProgName;
	}

	// Property accessors

	@Column(name = "FACTORY_ID", nullable = false, length = 3)
	public String getFactoryId() {
		return this.factoryId;
	}

	public void setFactoryId(String factoryId) {
		this.factoryId = factoryId;
	}

	@Column(name = "MODEL_NO", nullable = false, length = 3)
	public String getModelNo() {
		return this.modelNo;
	}

	public void setModelNo(String modelNo) {
		this.modelNo = modelNo;
	}

	@Id
	@Column(name = "APP_NO", unique = true, nullable = false, length = 4)
	public String getAppNo() {
		return this.appNo;
	}

	public void setAppNo(String appNo) {
		this.appNo = appNo;
	}

	@Column(name = "APP_VERSION", nullable = false, length = 10)
	public String getAppVersion() {
		return this.appVersion;
	}

	public void setAppVersion(String appVersion) {
		this.appVersion = appVersion;
	}

	@Column(name = "APP_NAME", nullable = false, length = 40)
	public String getAppName() {
		return this.appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	@Column(name = "APP_FLAG", nullable = false, length = 1)
	public String getAppFlag() {
		return this.appFlag;
	}

	public void setAppFlag(String appFlag) {
		this.appFlag = appFlag;
	}

	@Column(name = "APP_BIRTHDAY", nullable = false, length = 8)
	public String getAppBirthday() {
		return this.appBirthday;
	}

	public void setAppBirthday(String appBirthday) {
		this.appBirthday = appBirthday;
	}

	@Column(name = "APP_PROG_SIZE", nullable = false)
	public Integer getAppProgSize() {
		return this.appProgSize;
	}

	public void setAppProgSize(Integer appProgSize) {
		this.appProgSize = appProgSize;
	}

	@Column(name = "APP_PROG_NAME", nullable = false, length = 80)
	public String getAppProgName() {
		return this.appProgName;
	}

	public void setAppProgName(String appProgName) {
		this.appProgName = appProgName;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof PosApp))
			return false;
		PosApp castOther = (PosApp) other;

		return ((this.getFactoryId() == castOther.getFactoryId()) || (this
				.getFactoryId() != null && castOther.getFactoryId() != null && this
				.getFactoryId().equals(castOther.getFactoryId())))
				&& ((this.getModelNo() == castOther.getModelNo()) || (this
						.getModelNo() != null && castOther.getModelNo() != null && this
						.getModelNo().equals(castOther.getModelNo())))
				&& ((this.getAppNo() == castOther.getAppNo()) || (this
						.getAppNo() != null && castOther.getAppNo() != null && this
						.getAppNo().equals(castOther.getAppNo())))
				&& ((this.getAppVersion() == castOther.getAppVersion()) || (this
						.getAppVersion() != null
						&& castOther.getAppVersion() != null && this
						.getAppVersion().equals(castOther.getAppVersion())))
				&& ((this.getAppName() == castOther.getAppName()) || (this
						.getAppName() != null && castOther.getAppName() != null && this
						.getAppName().equals(castOther.getAppName())))
				&& ((this.getAppFlag() == castOther.getAppFlag()) || (this
						.getAppFlag() != null && castOther.getAppFlag() != null && this
						.getAppFlag().equals(castOther.getAppFlag())))
				&& ((this.getAppBirthday() == castOther.getAppBirthday()) || (this
						.getAppBirthday() != null
						&& castOther.getAppBirthday() != null && this
						.getAppBirthday().equals(castOther.getAppBirthday())))
				&& ((this.getAppProgSize() == castOther.getAppProgSize()) || (this
						.getAppProgSize() != null
						&& castOther.getAppProgSize() != null && this
						.getAppProgSize().equals(castOther.getAppProgSize())))
				&& ((this.getAppProgName() == castOther.getAppProgName()) || (this
						.getAppProgName() != null
						&& castOther.getAppProgName() != null && this
						.getAppProgName().equals(castOther.getAppProgName())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getFactoryId() == null ? 0 : this.getFactoryId().hashCode());
		result = 37 * result
				+ (getModelNo() == null ? 0 : this.getModelNo().hashCode());
		result = 37 * result
				+ (getAppNo() == null ? 0 : this.getAppNo().hashCode());
		result = 37
				* result
				+ (getAppVersion() == null ? 0 : this.getAppVersion()
						.hashCode());
		result = 37 * result
				+ (getAppName() == null ? 0 : this.getAppName().hashCode());
		result = 37 * result
				+ (getAppFlag() == null ? 0 : this.getAppFlag().hashCode());
		result = 37
				* result
				+ (getAppBirthday() == null ? 0 : this.getAppBirthday()
						.hashCode());
		result = 37
				* result
				+ (getAppProgSize() == null ? 0 : this.getAppProgSize()
						.hashCode());
		result = 37
				* result
				+ (getAppProgName() == null ? 0 : this.getAppProgName()
						.hashCode());
		return result;
	}

}